<script setup>

    import {onMounted,onUpdated,ref} from 'vue'

    onMounted(()=>{
        //onMounted周期下执行的方法 
        //初始化数据....
        console.log("-----onMounted------");
    });

    onUpdated(()=>{
        //每次更新数据触发
        console.log("-----onUpdated------");
    })

    let counter = ref(0);


</script>

<template>
  <div>
        {{ counter }}
        <button @click="counter++">+</button>
  </div>
</template>

<style scoped>

</style>